package com.hightrast.service.config;

import com.hightrast.service.util.SnowflakeIdGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class SnowflakeIdConfig {
    // 数据中心 ID，可根据实际情况修改
    private static final long DATA_CENTER_ID = 1L;
    // 机器 ID，可根据实际情况修改
    private static final long WORKER_ID = 1L;

    @Bean
    public SnowflakeIdGenerator snowflakeIdGenerator() {
        return new SnowflakeIdGenerator(DATA_CENTER_ID, WORKER_ID);
    }
}